<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="includes/add-include :: add-header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal" id="myForm" th:object="${menu}">
            <input type="hidden" name="menuId" th:field="*{menuId}" />
            <input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
        <div class="form-group">	
            <label class="col-sm-3 control-label">上级菜单：</label>
            <div class="col-sm-5">
                <input id="treeName" class="form-control" type="text" readonly="true"
                       th:value="${menu.parentName == null ? '无' : menu.parentName}" onclick="selectMenuTree()">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">菜单类型：</label>
            <div class="col-sm-5">
                <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="1" /> 目录 </label>
                <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="2" /> 菜单 </label>
                <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="3" /> 按钮 </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">菜单名称：</label>
            <div class="col-sm-5">
                <input id="menuName" name="menuName" class="form-control" type="text" th:field="*{menuName}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">菜单URL：</label>
            <div class="col-sm-5">
                <input type="text" id="menuUrl" name="menuUrl" class="form-control" th:field="*{menuUrl}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">权限标识：</label>
            <div class="col-sm-5">
                <input type="text" id="permission" name="permission" class="form-control" th:field="*{permission}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">显示排序：</label>
            <div class="col-sm-5">
                <input type="text" id="menuSort" name="menuSort" class="form-control" th:field="*{menuSort}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">菜单图标：</label>
            <div class="col-sm-4">
                <input id=" " name="menuIcon" class="form-control" type="text"
                       placeholder="例如：fa fa-circle-o" th:field="*{menuIcon}">
            </div>
            <input id="icon-btn" class="btn btn-warning" type="button" value="选择图标">
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">菜单状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getData('show_hide')}">
                    <input type="radio" th:id="${dict.dataId}" name="isHide" th:value="${dict.dictCode}" th:field="*{isHide}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictValue}"></label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注</label>
            <div class="col-sm-5">
                <textarea class="form-control" id="remark" name="remark"
                                  rows="3">[[*{remark}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-5 control-label"></label>
            <div class="col-sm-3">
                <a class="btn btn-info btn-rounded btn-lg-rd" onclick="edit()"><i class="fa fa-bell-o"></i>&nbsp;保存</a>
            </div>
        </div>
    </form>
    </div>
    <div th:include="includes/add-include :: add-footer"></div>
    <script th:src="@{/script/system/menu/edit.js}"></script>
    <script type="text/javascript">
	    var prefix = ctx + "system/menu";
    </script>
</body>
</html>
